package pers.vic.practice;

/**
 * 描述: 测试页面置换
 * @author Vic.xu
 * @date 2022-04-02 8:13
 */
public class TestPageReplacement {


        public static void main(String[] args) {
            //int[] pagesSequence = {0, 1,2,0,3,0,2,1,2,0,4,0};
            int[] pagesSequence = {7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0, 1,7,0,1};
            System.out.println("*****************开始测试FIFO页面置换算法*********************");
            AbstractPageReplacement fifo = new FifoPageReplacementStrategy();
            fifo.replace(3, pagesSequence);
            fifo.replace(4, pagesSequence);

            System.out.println("*****************开始测试LRU面置换算法*********************");
            AbstractPageReplacement lru = new LruPageReplacementStrategy();
            lru.replace(3, pagesSequence);
            lru.replace(4, pagesSequence);
    }
}
